export default {
  id: 'user-list',
  table: {
    data: [
      {
        date: '2016-05-03',
        name: 'Tom',
        address: 'No. 189, Grove St, Los Angeles'
      },
      {
        date: '2016-05-02',
        name: 'Tom',
        address: 'No. 189, Grove St, Los Angeles'
      },
      {
        date: '2016-05-04',
        name: 'Tom',
        address: 'No. 189, Grove St, Los Angeles'
      },
      {
        date: '2016-05-01',
        name: 'Tom',
        address: 'No. 189, Grove St, Los Angeles'
      }
    ],
    attrs: {
      stripe: true,
      border: true,
      'default-sort': {
        prop: 'date',
        order: 'ascending'
      }
    }
  },
  columns: [
    {
      id: 'date',
      attrs: {
        label: 'Data',
        prop: 'date',
        sortable: true
      }
    },
    {
      id: 'name',
      attrs: {
        label: 'Name',
        prop: 'name'
      }
    },
    {
      id: 'address',
      attrs: {
        label: 'Address',
        prop: 'address',
        'show-overflow-tooltip': true,
        width: '200px'
      }
    }
  ],
  pagination: {
    'current-page': 1,
    'page-size': 10,
    total: 99,
    attrs: {
      background: true,
      layout: 'total, sizes, prev, pager, next, jumper'
    }
  },
  filters: {
    id: 'user-list-search-form',
    submitText: '查询',
    form: {
      action: '/user/list',
      method: 'get',
      model: {
        keywords: '',
        status: ''
      },
      attrs: {
        inline: true,
        style: {
          'grid-template-columns': 'repeat(3, 1fr) auto',
          'grid-template-areas': `
                    "status keywords . form-submit"
                `
        }
      }
    },
    fields: [
      {
        'field-type': 'input',
        'field-label': '',
        id: 'keywords',
        model: 'keywords',
        attrs: {
          placeholder: '请输入关键字搜索'
        },
        'grid-area': 'keywords'
      },
      {
        'field-type': 'select',
        options: [
          {
            label: '所有',
            value: 'all'
          },
          {
            label: '激活',
            value: 'active'
          },
          {
            label: '待定',
            value: 'pending'
          },
          {
            label: '禁止',
            value: 'banned'
          }
        ],
        'field-label': '',
        id: 'status',
        model: 'status',
        attrs: {
          placeholder: '用户状态'
        },
        'grid-area': 'status'
      }
    ]
  }
} as TableGlobalType
